Fix several observed issues

Fixes #939