Fix tests and server bugs (STOX-31)