Fix incorrect buttonIndex type