Fixing null failure modes for functions