Check for files before performing operations. Fixes #27.