Fix errors for invalid function in compiled code