Fix some server-side code issues. Closes #3.