Fixed server stopping and fixed a bug in link measurements