Bugfixes

More bugfixes, including goddamn tabs
Merge commit