Fixed Division by 0 when minimizing window