More tests, improvements