Updated populate script to work in sub directory