Reverted mono fix because it breaks on .net 4
Fixed mono fix by checking if the Enum value exists in the runtime.