Fix invalid cast when destination type is nullable
Fix for nullable enums