Fixed nullpointers and other errors in server

Hopefully I didn't mess things up, but the server launches for me now.