fix a bug in ArrayND