Added threading to the docker stop, cleaned up some various
syntax related bugs