Fixed and optimized how checksummed files are written