merging in changes from trunk 585cfadb5c2709add860a994b2426671f794a9e9