Kosterlitz-Thouless behavior in layered superconductors: the role of the vortex core energy.