Small modifications to joefiorini's server code