Fix numerous warnings