Fix #15 and various server-side tweaks