Some simple changes for hopefully better garbage collection