Fixed enum parsing, added test.