Fix some stuff found by IntelliJ's Analyze code feature.