File handle, connection count added and various improvements