Fix bug in calculating leafentry sizes, and clean up header calculation
reduce size of elements due to slightly larger overhead in leaves