set -e doesn't play nice with that return 13. Not sure about the reasoning behind it since the script isn't using any traps, the commit where it was introduced doesn't give any reasons for it either. If you find it useful, feel free to pull upstream.
If cd fails, don't run pwd
If you're using set -e (and why wouldn't you), this halts all execution