Move keychain call to after function defs.