while -> if, since we will hit it again in the outer loop.
Merge branch 'application_stop_fix' into make_mac_compile_hack