addressed g++ warnings and valgrind complaints
merge master
Merge pull request #10 from Kojirion/master

Addressing valgrind complaints and g++ warnings