Fixed issue with rules with positions "begin" or "exact" being applied only when target and replacement have equal length.