Fixed bug in timeout of sockets.
Added validator selfchecks to mocha tests.