Remove useless assert(), also fix a bug due to a problem with StringRef