Fixed a bug in the fix. Fixes #2362.