More encoding fixes for pass_gen.pl