Fix SF#1516184 and add a test to prevent regression.
2 files changed