Handle unexpected strings properly (bug 826534)