Fixed bugs in train tab