Fix some buggy methods for using nil as null [ci skip]