Bug fix from Bocheng