Fix next_default_name function to continue working in IE < 10.

Fixes regression introduced in #27.