Update rotate routine for the case where nrecords is 0