Added data nil checks to each field being written