Check if index file exists before calling mtime.

Closes #1.