FIX: various bugfixess