Check range of data before writing int16