FIX: No longer segfualts on shutdown (caused by improper closing of socket)