Various changes from IntelliJ inspection