common: Don't use 'dir' variable

Using dir variable name was hidding implicit variable used in functions
file and some other.

Weird.