Fix offsets for M array