fixed warning about int func with no return val
another attempt to track down osx10.9 string problem
improve scope of variable based on cppcheck output