fixed some syntax mistakes.
Deleted the unused variable.
Remove ugly switch
Merge pull request #24 from peers/yosssi-master

Server fixes