BUG: bug when using chunksize and writing ndim > 2