Fixed server crash bugs