tidy up and fix warnings
Merge pull request #4 from quicksilver/pjr

tidy up and fix warnings