Make c variable local
Finish on deinit (close sockets)
Remove unused library functions