fixed memory leak
Implemented gll_clear plus tests