Fix the issues we discussed today

This fixes the portability issue we noticed in the server, and closes issue #1.

I didn’t touch #2 as you considered it not worth my time for now, and because it would change the API for clients (most likely in a way that does not break backwards compatibility, though).