test for issue #686
fix for within_frame issue #686
Merge pull request #969 from twalpole/within_frame

Test and fix for within_frame issue #686