Fix encoding bug in keyword model