Fix for converting flags to regular value
Fail louder on null pointers