fix auto-capitalization bug

cherry-picking fix from
https://github.com/moredip/KIF/commit/9a7574f6517b34f90cde0814ee4480b559ca5b5