Fix some errors cropping up on CentOS

- Ensure newlines are interpreted (echo -e)
- Explicitly set $oldpwd instead of relying on the builtin 'cd -' syntax