made destructors public, removed offsets from read/write methods, improved error reporting for linux