Made scratch detection less I/O intensive and more robust.
Touched up formatting of exception handling as requested.
Merge pull request #122 from fgimian/lessen-io-activity

Made scratch detection less I/O intensive and more robust