Fix errors to be serializable