Fixes issues #175 and #176