Test for return code

Test for existing file to prevent warning if file could not be deleted