This patch fixes replacements that are not applied when relative paths are
specified.

In particular it makes sure that relative paths for non-virtual files aren't
made absolute.
Added unittest test.