Fix window memory leak, check for other leaks.
closes #7