memory leak fixes
Merge branch 'master' of https://github.com/mgarnier/PAA_2013-1_T2

Merging latest fixes (me) with features (willian)