Improve switch test correctness