Fix Bugs #182 and #192