Getting 'bool(false)' output before normal page HTML I've seen this happen once or twice before, but can't remember where or why.

Basically, in one of my page's HTML output, the first line of HTML is returned as 'bool(false)' - On that particular page, I have a function in hook_init() that logs in a user using user_login_finalize(). Here's the HTML from the

page:bool(false)
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML+RDFa 1.1//EN"&gt;
&lt;html lang="en" dir="ltr" version="HTML+RDFa 1.1"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
...


On the page as displayed, I get a blank line above my theme's header with this bool(false) appearing.

On refreshes, that goes away (basically, it only happens when I log in a user programmatically using user_login_finalize()).
It seems that the problem went away if I commented out the user_module_invoke() call inside user_login_finalize().

Obviously, I didn't want to maintain a patch for that, nor did I want to take out that behavior, as I may want to use hook_user_login() sometime. So, I basically copied user_login_finalize() into my own private function, removed the user_module_invoke() call, and am now using the private function for my particular need. Seems to be working fine!