Fixes remove space / unicode string bugs and adds unittests