Catalog locking cleanup and bug fixes