fixed compilation problems and added a check for the prepared replacements file