Bugfixes

Among them, a crash fix