Server scripts: Fix/improve many warnings