Fix bug in prior grounding.