Added scrutinizer config.
Fixed some issues detected by scrutinizer.