Various client/server bugfixes.