Fixed convert spaces functionality

Made changes to support proper functioning of the convert spaces flag.
Merge pull request #108 from cdaveb/master

Fixed convert spaces functionality