Fix footer calculation