Bugfixes

Should be working as intended.