Make range type visible; ensure a range doesn't contain interfaces of the wrong type (static/dynamic)

This pull request resolves issue #289 (finally).