Fix off-by-one error in distance calculation (n - m).
Fix off-by-one error in distance calculation (n - m).

meganz/sdk,Acidburn0zzz/sdk,Acidburn0zzz/sdk,Acidburn0zzz/sdk,Acidburn0zzz/sdk,meganz/sdk,meganz/sdk,meganz/sdk,meganz/sdk,Acidburn0zzz/sdk,meganz/sdk,Acidburn0zzz/sdk,Acidburn0zzz/sdk,Acidburn0zzz/sdk,meganz/sdk