fixed some minor bugs and added some tests for FilePreProcessor.cs