small Bugfixes for bugs found by scrutinizer