BUG: Fixed encoding bug