reordered the cdf file generation
fixed lots of fspc bugs