Keys enumeration and units tests fixes