Minor inmprovements in cmake
Reference in attributes fixed
Reference detection performance improved