fix scrutinizer suggested bugs