Adds new test + fixes some issues.