Bugfix for issue 419 and .gitignore fixup
Two different things fixed.

thanks, ralph. i cherry-picked that last commit and add all `*.cpp` files to the .gitignore. you'll want to revert to before your changes above and then pull wesm/master so you don't have that merge commit...annoyances of maintaining a clean repo in git. alternately make a pull request next time out of a branch 
