Fix minimize functionality.