Fix bug caused by typo in checking of button_type