Don't prepend space if the line ends with space

Refs #28