removed compiler warnings from replace.cpp