Replaced free with release on a few lines