Fix swapped variable names to accurately reflect usage
Plug memory leak during index creation
Merge pull request #271 from nbougalis/cleanups

Cleanups