update tests and bugfix