Fix from_str method.