Fixed resource leaks in task prosessor service. and NPE in network A
service.