pyPutFile: data name bug fixed; fixing ending logic