Attempt at memory issue cleanup