(#3812 and #3828)Implement isDefaultValueConstant and fix getDefaultValueConstantName

This should resolve #3812 and also resolve #3828.