Fix issues as shown by Scrutinizer