Fixed enum checking functions not being called in generated code