Fixes #78 and #81