Fixes to server.js