Fixed handling of replacements of Any type