Fixed issues with sticky headers where headers outside the viewport were used in header positioning computations (also reverted some prior changes as they resulted in regressions)