Memory leak fix and updating README