Could it be because you're using $Buffer = ' '; and not $Buffer = '';?
In reply to Re: Annoying whitespace(s)... by ikegami in thread Annoying whitespace(s)... by reaction