Fixed a couple of memory leaks
Merge branch 'refactor' of https://github.com/nikhilRP/idr into refactor
Fixed a stability issue