Properly free instance memory; removed unused variable.