Several ugly warning fixes