Fixed goroutines not terminating
Various bugfixes
Everything seems to be working, but nothing is really working.