Extended IOManager.get_next_file_name().

The method now knows what to do when no versions directory is found.

The method also now starts numbering at 0001 instead of 0000.