Fix enum encoding bug for compound keys in protocol v2