Merge pull request #197 from wtangiit/master

two bug fixes