Fix renderHelper for arbitrary function