Add failing unit test, add trim() to make test pass

Trying to merge to master instead.