Bug fixes
Merge pull request #1 from bathompso/master

Bug fixed as suggested