memory leaks fixes; inline cache fix