Fixing bug in processing char and str function