Fixing bugs after the merge with 4.1 original release.