Use better handling for minimizing tabs