More tests and better debugging.