Fixed a bug with charachter counting.