Catch exceptions more strictly.

Make sure that the key file name does not exist already.