fixed integer_to_short and memory_write16