Issues/81

Fixes #79 and #81.