Fix more memory leaks

Change-Id: Ifce3177d491deb953380156237bc8c88aeecd614