Vector magnetic fields in sunspots