fix scan-build warnings
string array methods has cosmetic changes
fix scan-build warnings in test