Additional test cases + bugfix.