Actually bringing in the meat of the change from #629.