backport of #1022 to 0.6.x

good if this can make it in to 0.6.0-GA.  mainly small safe things.