Merge pull request #1459 from DanWin/stable-1.1

More memory fixes