Fix TypeError
(cherry picked from commit c4591a16e1781f8da3502b38e3dc72f629478312)