Prevent line statements eating newlines (fixes #52)

This is just a copy of @gavento's fix in #52.