Fixed main file generation, fixed escape character parsing