Fixed a case when arrays where zero-length