Bugfix & new test cases.