Re-added and optimized server_shutdown(), and fixed a test that was failing due to the ploc() modification.