Fixed thread safety in Knowledge Base