Fixed enum encoding + test.