More tests and fixes.