Added ext argument to expandFile