Populate compareWith from session if not passed.