fix guess prefix

oop, basename / dirname swapped