some fixes, still leaking