Fix for \n replace bug (replace only replaces the first occurrence)