Fixed check for number of accepting sockets when creating port handler. Cleaned handlers a bit.