Fixed minor track detection bugs