A simple change to change_pathname() to ensure that the error output