Make replacer work with staticmethods.