Fixed r.literal in update.
fixed replace regression
added tests
Merge branch '1839_fix_update_literal' into next
Merge branch '1570_fix_replace_regression' into next