Move to intellij, fix some warnings