bugfixes

all found while working on thesis