Fixed errors with stopping server