misc fixes; more tests