misc fixes, reflected in tests