Remove some debug
Add integrity check for write/pwrite