Fix AnchorNotFoundException when another exception occurs during deserialization.