Max distance for detecting direction, fixes #3