Tunable coupling of qubits: Nonadiabatic corrections