Fix cwd problem

@struys If you could double check this before I merge that'd be awesome