Small fixes discovered by scrutinizer