Fixing length lookup when last trackpoint is empty