Correctly detect empty collection