Issue with distance maps generations