Fixing issues #81 and #82