Fixed server bugs