Kubica leaves hospital after leg surgery