Handle +nil+ values for query.