Fixed issues with signals, timers, TCP memory management