Fix #23: Logging causes memory use to increase forever