Presently 'which' selects the first word. When synthesizing a shell 'which' cannot be certain if shell reported by 'ps' is interactive. Presently just assume it is interactive. If you use which in a script then use 'which -p' to be safe. Its too slow.
Some shells can get themselves confused when the hash table gets out of sync with the executables.
In this case the rehash command is needed in the shell to remedy this. Which will do a direct path search and will not be confused, thus it will report, correctly, while not matching what the shell thinks about it. Version information of the shell, reported with -d, is from a synthesized shell not from the actual shell. This can be confusing if a new version has just been installed and 'which' is run from a different version.