Fixing Qi's bug.