Mainly fixed crashes due to UTF-8 characters. Fixes issue #6.