fix a bug for mixed case

ASCII starts from zero. And also test mixed case.