merging in changes from trunk 82b38144e405dd589f752c76a01f5d98afcdc75f