Fix for script error when gagging/ungagging

from the server console. Also a better way to handle error messages.