A few bug fixes for the server