More tests, some fixes