Fix other issues detected by Scrutinizer