Refcount fixes to Sicstus BDD management, plus more crappy logging