Make sure we don't pass destination for source and vice versa

Originally contributed by Rob Worsnop.
Merge bug26434