Test of some stuff not well covered by the UI tests, and changes based o...

...n the tests.