Corrected bug with coordinate neighbors