Fixed some memory leaks; parser tweaks.