Fixing calculation of locality index #7