mserver/mclient: cleanups