Fix debug & Allow to enable proxy & Fix memleak (open files should be closed).
Id of connection should be incremeneted.