various minor bug fixes; allow \n in replacements
updates for 1.0.5.3