some tests and bugfix