Surface Integrals and the Gravitational Action