fixed the tests, related to the basename behaviour, bug #66395
fix null pointer deref