This parsing code was written sloppily, assuming that it wouldn't have to deal with spaces or quotes or anything. You have to be a bit more careful here: the value of "label" could be a lot of things: it could be surrounded by quotes, in which case we need to remove them, etc.