use unsigned for loop variables
add missing newline to types.h