Fixed some missing details in replace() which resulted in some ugly side effects.
Fixed some missing details in replace() which resulted in some ugly side effects.

sebastian-software/jasy,sebastian-software/jasy,zynga/jasy,zynga/jasy