FIX: a couple of bugfixes