Fixing getVariableForRead calls, moving typeof optimizer to base comparison [ci skip]