Fixes to analog ranging