bugfix, updated tests.