BUG: #2503 Fixes performReadonlyTransformation for OptionSetField

NEW: Adding unit test for performReadonlyTransformation #nd fixing OptionSetField #2503

BUG: Fixing undefined variables and function parameters for PerformReadonlyTransformation unit tests

NEW: Adding unit test to OptionsetField for read only fields