Graft test changes from Andrius branch.
Add correct test results.
Refactoring.