Fix issues reported by IntelliJ IDEA