Various fixes and consolidation