fix issue with offset of values written *after* array with missing elements