Fix #16504

This is a deep fix, we need to test it thoroghly
Merge pull request #16759 from thatch45/fix_salt_val

Fix #16504