changes global directory to working directory. and small fixes in the tests