Fixed leak errors