Fix minimize behavior.