Add checks in MainWindow for unnecessary components.

Resolves issue #168.