Fix invalid types comparison which leads to invalid timeout assignment