Fixed issues reported by Scrutinizer