CORE: Fix for sql error on character login