Negative activation energies and curved Arrhenius plots. 1. Theory of reactions over potential wells