Fixes from scrutinizer