Fixed bug in writing/reading-value