Fix server-side script and outputs