Accurate geometries from ab initio calculations: systems containing second-row atoms and transition metals