[services/textproc/brain] fix logic errors