Add an error detection code to linear_relation