Guard against divide/multiply by 0 in RL task distribution (#4362)