Fix next_default_name function to continue working in IE < 10.