Fix broken integer_decode function

Decoding function in integer.c was broken now it is fixed following integer representation decoding from specifications.