Some changes to start supporting unicode properly