Fixed two memory leaks and wrote memory specs
Merge with changes to README.md on GitHub