Fix forceclose on exit