Test copying non-existent file

Also tidy up assertions and debug logging.