fixes for multi-file and cuda reductions