Fix encoding tests