fixed a lot of stuff. HeapFileReadTest still fails.