Updated checking for key and cert files.