Corrected tab selection; removed unused function