fixes for parallel SGD