Some tests and fixes.