add fieldsToTable in DATASTRUCTFUNC; bug fix for batchEffectPCA