Fixed more WGS-related bugs