Leaks fixes and alias fixes