Fixes #96, #77