Warning fixes v3

This fixes a series of warnings across the system. Please perform a careful code review, then merge at will.
This is actually was correct. We have no direct way to detect sonar updates, so only can hope that distance will be a bit different next time, so we are checking if number changed or not, not that it changed by some amount. I don't think that it will make big difference in output, but '!=' was really correct here.