Was checking for empty arrays incorrectly.