Support writing negative values, added flush