A bunch of warning fixes based on IDEA's inspections.