Merge pull request #747 from bartcharbon/master

fixed bugs 133 and 687