replace_code is now a boolean flag.