Fixed a double free that was causing freaky issues