Allow IDs to be set directly, and fixed up unicode issues