Fixes #76 and #79