Some fixes detected by xcode analyze