Fixed several minor but show-stopping bugs, and added missing line to kill wpa_supplicant.