added error support; added checksum support; fixed freeing bug