More bugfixes

Adds to the previous commit, some code was deleted there because of
failing with github
Add Intellij files