Bugfixes

Wow, I haven't updated this in a while