Make sure script functions exist before calling