Debugged flux spectrum for homogeneous and heterogeneous cases. All input files should work now.