Fixed warning (unsigned comparison) in msReplace()