Fixing preflight logic or return errors. The issues were the
setInPreflight was not getting reset back to false on exit from the
functions.