Fix bug - potentially invalid pointer.
Merge pull request #366 from christopherreed/fix-removeFile-crash

Fix bug - potentially invalid pointer.