Memory leak fix (M. Verweij).