Made drawRectangle check for empty vars.