Fixed replace tag bug

Program no longer crashes when '&', '<', or '>' is used to replace a
tag.