GUVNOR-2122: Fix support for Enums.

(cherry picked from commit 5dae59d89d65fa94439a1f64def1a27bcdf97a60)