Fix exception when passing a nil value for a hash param required in a hash