Add a comment and fix a memory leak. Thanks to Vikram for pointing this out.