Amended changes from previous PR.