Fix to user server error handling

Also synced with php-client