Fixed error handling for distance opt args