Fix issue #168 and #163
Merge pull request #170 from ArcBees/jd_168_163

Fix issue #168 and #163