CDB-2891 branch stabilization and proper fix for layers (hopefully)