Fix crash when script uses only sendtofactory