Fix various tab bugs