server.py: more test coverage, fix bug in last line