some tests and a fix