Fixed jUnit tests and bugs related to test failures.
Fixed bugs causing errors in subproject tests.
Merge commit 'bb442653516e5d079c925e0b300256001c541fb5'

Bugfixes from subproject.
Merge commit '3f979db14fb347c16ebe6603217dcded9b2710f5'

Bugfixes from subprojects.