Fixed the handling of the key manager among different classes...