Fixed encoding bug