Change int to uint8_t. Let declare variables consistent
merge to fboris