updated tests and bugfix