Simplify example, fix Getwd() bug