fixed bugs in vector deletions,releasing IplImages created using cvCloneImage, and update of new file gmswriter_fixed.cpp