Fixed crash when connecting with vanilla client. Fixes #630