Fixed CLR switching behavior in tests