Added memory leak checking, fixed enum references, regenerated documentation