Remove dead conditionals

Fixes CID #965943 #965949
Fix integer overflow

Fixes CID #966079