Pulling in relevant code from master.