Fixed passing non-Ranges into Document methods

Fixed regression from b23265ad: ! takes precedence over instanceof.