bugfixes to getpwd + server.c source