Fixing a bug in str2Dom