Made setwd even more robust