Support scripts with embedded function under /main