fix bugs in prior knowledge computation