Fixed bug causing the server to crash.
(Should work fine now, but needs to be tested more).