Correct issues highlighted by scrutinizer