fix problems in the selftest