Assorted fixes to make it work
Fixed thread killing and restarting, including via commands