use the correct basename function, fix unsigned value handling picked up by clang