Writing the wrong size. Changed int -> short
Writing wrong data size