A device for providing a gas composition and temperature compensated acoustic measurement of the level of a liquid surface in a tank, said device comprising: - a transmitter (10,100) adapted to transmit acoustic signals; - a receiver (10,100) adapted to receive reflections of said acoustic signals; - a waveguide for guiding acoustic signals from said transmitter (10,100) to the liquid surface and for guiding reflections of said acoustic signals back to said receiver (10,100), the waveguide comprising: - a first end connected to the transmitter (10,100), - a second end adapted to extend into the liquid, - a reference element arranged in said waveguide; - a reference portion extending from said first end to said reference element; and - a measurement portion extending from said reference element towards said second end; characterized by: a channel extending from at least one inlet (41, 41') in said reference portion to at least one outlet (44, 45, 46, 47, 48, 530) in said measurement portion, said channel being separated from the waveguide so as to provide a fluid connection between the reference portion and the measurement portion independent of the waveguide, and a gas-pump (40,100) arranged to, during operation, create a gas flow in said channel from said at least one inlet (41, 41') to said at least one outlet (44, 45, 46, 47, 48, 530). - a transmitter (10,100) adapted to transmit acoustic signals; - a receiver (10,100) adapted to receive reflections of said acoustic signals; - a waveguide for guiding acoustic signals from said transmitter (10,100) to the liquid surface and for guiding reflections of said acoustic signals back to said receiver (10,100), the waveguide comprising: - a first end connected to the transmitter (10,100), - a second end adapted to extend into the liquid, - a reference element arranged in said waveguide; - a reference portion extending from said first end to said reference element; and - a measurement portion extending from said reference element towards said second end; characterized by: a channel extending from at least one inlet (41, 41') in said reference portion to at least one outlet (44, 45, 46, 47, 48, 530) in said measurement portion, said channel being separated from the waveguide so as to provide a fluid connection between the reference portion and the measurement portion independent of the waveguide, and a gas-pump (40,100) arranged to, during operation, create a gas flow in said channel from said at least one inlet (41, 41') to said at least one outlet (44, 45, 46, 47, 48, 530). - a first end connected to the transmitter (10,100), - a second end adapted to extend into the liquid, - a reference element arranged in said waveguide; - a reference portion extending from said first end to said reference element; and - a measurement portion extending from said reference element towards said second end; a channel extending from at least one inlet (41, 41') in said reference portion to at least one outlet (44, 45, 46, 47, 48, 530) in said measurement portion, said channel being separated from the waveguide so as to provide a fluid connection between the reference portion and the measurement portion independent of the waveguide, and a gas-pump (40,100) arranged to, during operation, create a gas flow in said channel from said at least one inlet (41, 41') to said at least one outlet (44, 45, 46, 47, 48, 530).