fixed pointer and  problems for no warnings compilation