Fix unit tests and server bug.