Fixes #89 and #91