Coverage and maxSockets bug. Closes #1535, also #1524