rebased bug 783499. fixes to address review comments for bug 808370