Fixed bug causing tabs to select improperly;