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