We give a review of recent advances in the accuracy of atomic fountain clocks. The new features are improved experimental and theoretical treatments of distributed cavity phase shifts and a full modeling of microwave lensing. Here we highlight that state selection is often highly non-uniform when Rabi flopping is used instead of an interrupted adiabatic frequency chirp. We show that detuning the state-selection microwave field as well as changing its amplitude can give a much more homogeneous state selection. A spatially inhomogeneous state selection corrupts the density extrapolation because the density distribution changes, which also mixes effects from distributed cavity phase and microwave lensing. This is expected to be important for the microgravity clock PHARAO on ACES, and can also improve fountain clocks.