Bugfix: Trying to read from (half-)empty buffer returns incomplete data
Updated code (non-functional)

Now PSR-2 :X