Switched variables for error detection