Fixed bug, where null values in enums would throw an exception