Prevent function from generating EOL whitespace
Fix tests, remove EOL whitespace