Fix negative track length bug