Issue #8, misc fixes, cleanup