Fixed issues finded by scrutinizer-ci