Testing cleanup of n-gram handler