More warning fixes

Got rid of all warnings when building server_release (at least, I don't see any when building under linux x64) by eliminating several unused variables/dead code. Also fixed an incorrect sizeof parameter.