Fix invalid assert and paircmp check