Don't check files twice, properly escape file names, wait until quitting to let the buffer flush, don't give up on the first error