fixing issue #62 and fixing some cases i missed in earlier fix for issue #71
Merge pull request #75 from danhamlin/master

Fix for Issue #62 and #71