Server: Fix compression, add unit tests.