Fixed a few small bugs with keychain