ENH: Fixed encoding bug