Also, this line:

if QuadRendering == "1"

should be

if QuadRendering == 1