WIP - Bugfix for trailing whitespace on a line with no code

Added a test from issue #359