Fix square function + other controls