More warning fixes, not sure how some of this code ever worked!