Use replace for manipulating CourseLocator, so that deprecation is preserved

oh, and this one as well.