If a person was illegally detained, a court could order a writ of habeas corpus for their release.