fix partial highlighting bug when encountering an empty string
fix GCD locking bugs