Fix bugs in ticket import