changed long to tkey_t, modified ERASE signature, other minor fixes