Various fixes, enchancements

Fixes #9