Fixed logic in sourceswitch to match .NET behavior