#1998: merged changes from the branch to trunk (btw. this branch was difficult to merge back to trunk because of it's specific structure)