bak: fixed directory handling