Fix for a typo that causes a memory leak