Fixes several uses of enum. Also fixes #53