Fixed a few edge cases in CollectionLayout