Fix rule application to check name of matched function.