Added some exception handling for opening multiplex sockets, cleaning up program flow