Added logging and fixed (implemented) parameter replacements