I don't have environment to try this out, but afaik, a symlink is a "file" that contains path to another file (simply put).
So when you chdir, it does change to the directory that you asked for, and `pwd` too, does its job honestly. So, it seems nothing is wrong with the functions. I think expecting `pwd` to return the path of symlink is not correct, because symlink is a plain file and not a directory file :)