fix offset and nulls