Merge pull request #128 from ahmedcharles/settings

Fix more crashes when the window is closed before the settings dialog.
Resolve ambiguity between boost::tie and std::tie, pick boost.