fix up spawning of gates in templates
clean up some issues related to the differences in handling
between dedicated server and integrated server (ints being truncated to
bytes for block events, and to shorts for container progress bar
updates)