misc fixes
beginnings of a test suite