Changed try/except block for isinstance to diffetially detect line or poly collections.