Added a few null checks relating to the MetroWindow's overlay.