Added check for name property and fall back to toString for IE.

Fixes #735