Fix null reference exception: Cast the control to IMacControl before dereferencing.