make sure we don't mess up cwd
make sure we have a string repr of the id

this fixes wierd UTF-8 issues on os x.