tweaks and fixes for tests

See individual commits for actual changes