Various bugfixes

\o/