Some improvements have been added, particularly concerning the freeing memory action