Remove dead conditionals

Fixes CID #965943 #965949
Fix integer overflow

Fixes CID #966079, #966078
Remove unused pointers

Fixes #966530, #966532
Fix uninitialized scalar field

 CID #966282, #966283, #966284, #966285, #966286, #966287, #966316,
 #966343, #966349, #966363, #966364, #966366, #966370, #966373, #966374,
 #966376, #966377