CFY-988 fixed bug: there was no expanduser() on path for keypair when checking if it exists