Fix bug in batt-tray script for full battery
Minor c++ dev enhancements