Fixing #89 and #91