Fixing 2 bugs in addFromString method