Pass All Tests

Various fixes to pass all tests. In particular, getHeaderSize() in
HeapPage requires double casts.