Fix prior calculation

Thanks, Robert!