made open/openWrite to futures, fixed a few errors.