Fixed a typing error

Fixed a typing error and some old style code that caused the server to
crash.