fix ninflight counting
Merge branch 'master' into portable