fix Datamatcher's idstr() method when calld for dirs
fix basename optimization for STRINGEND

broken with commit 0804020d92975c20a683f490f81339c14555b2d4