Bugfixing, new tests