Merge and fix hooks for beliefstate logging