An unadjusted error of 40 feet is perfectly acceptable.
The altitude determined by a barometer depends on the reference (sea level) pressure, and due to weather changes, can go up and down by hundreds of feet in a day. The sea level reference has to be adjusted nearly every day.
Since the sea level reference pressure is not in the code you posted, it must be in the library.