Improved server-update loop to be more reliable.