Make sure that the correct context is being passed in for replaceWith(fn). Fixes...