Patched tolua to emit range checks for enums