Fixing misc issues from scrutinizer