Merge latest changes from the 1.0.x branch.