Fixes for tests t00xx

Miscellaneous fixes for problems uncovered in scala/pos tests.