Add proper support for the close button.