Fixed some KeyManager issues.