Fixed removeTab() function