Fix for in program protocol for ending scripts