Bring in changes before 1.0.5

More changes to support 1.0.5.