Added option to minimize on close.