Fixed bug where file paths weren't always properly sanitized.