Fix problem with relative distance caluclation when marker is input