Fix #82 and #81