Added temporary(?) fix for a memory leak.