Cleanup with IntelliJ's inspector, fix compile