Fix cov 52220 (unchecked null return)
Fix cov 52219 (unchecked null return)
Fix cov 52218 (overflowed constant)
Remove dead code (coverity 52208)
Fix resource leak (coverity 52153)
Fix null dereference. Cov #52146