nbfiles can be NULL - set nbfiles=0 in that case