Fix check for empty array.