Ensure destination and source are available before mangling them

Fixes #1918.