Fixed all memory leaks except unplugging
Comments added


Signed-off-by: chmod <chmod@liss-e.gr>