Handle case where decoder length is longer than the data given by breaking out at the point this is detected + addition of byte and correct handling of signed long