Fixed some error-handling in frag scripts