More tests, more fixes