Various changes from IntelliJ inspection

... for your consideration.