Corrected flatfail not returning correctly