Fix typo; Fix replace function(it replaced all the matches instead of just one).