Fixed bugs where enum variants are considered variables

Closes https://github.com/PistonDevelopers/image/issues/151