Fixed a bug with handling arrays with holes.