Some fixes. Info given by Scrutinizer