Brought in fixes from another branch.