properly read unsigned values