Hysteresis and Phase Transitions