Fixed two replace bug