Merged with inhouse changes.