Fix JS references to recursive functions