A bit more tests and bugfix.