Fixing some issues indicated by Scrutinizer