Fixed offset bug in memory free
Rollback of previous commit