Fixed #599 in server-main