Fix hashing problems for Subs with Dummy's (e.g. #7068)

Fixed issues: #7068, #7231