Synced with changes from SVN r18002