Misc fixes, closes #6