Added test to verify that sourcePosition is copied on replacement