Corrected logic for writing output file fslfill2.