chdir resolution
Add a test case for chdir with relative path.
Move variable declaration to the top.
Update changes.