Avoid lots of {compile} calls, also avoids an apparent memory leak.
Merge pull request #1675 from setowns1/bug

Avoid lots of {compile} calls, also avoids an apparent memory leak.
Merge branch 'dev' into gui