Rework catalog. Fix small bugs with cataloging