Fixing encoding bug