Incorporated modifications made in the source/2.0 branch.