Fix #74 and #81