Fix peer state recording