various fix on text operations.