Client and server bugfixes