tab handling improvements