Used signed variables to store the result from read/write.