formatting fixes
fix various compiler error and warnings
6.40.7