Fixed encoding bug.

Fixed an issue where the encoding (unicode) would cause a crash upon
injection.