Bug fixes to prior