Fixes a bunch of scrutinizer warnings.