Slow passage through a transcritical bifurcation for Hamiltonian systems and the change in action due to a nonhyperbolic homoclinic orbit.