Changed order of method definitions...
Modified server code.
Corrected typo.
Inlined some code.