Fixed errors in code

There was an error in the logic for distant targets, and there was a
missing comma in the coordinates of a target.