fix loop condition and integer_types