fixed memory leaks on items and general warnings