fix some types and nulls checking in previous commit