Bug fix: Closing the main form didn't terminate the app