Fix bug on track boundaries.