Fix incorrect array length