Fixed server crash on startup. Fixes #176 #183 #186