Added unicode functionality. Some bug fixes.