Port to Xcode 5 + bug 6.1 fix (terminate app after last window closed)