Fix many IntelliJ warnings