Made test and fix for trailing whitespace problem.

Fixes #23