[eluser]Dam1an[/eluser]
For testing sake, lets hack the core (I just want to see if it will work)
open /system/libraries/output.php
Find the _display function
Go to line 351, this is where it echo's the output, therefore sending it to the browser
call trim on the $output before echo'ing it
If that doesn't fix it, then I have no idea whats going on