Fix bugs with the CollectionHasItems expression not supporting generic and non-generic collections well.