Fixed a small memory leak in the tests and enabled some other tests
which had been switched off.