Fix a bug that prevented polling the proper number of sockets.