Fixed bug with working directories