Mitigation of the effects of multivalent ion transport in reverse electrodialysis