More tests and little fixes