Thanks for all the help from everyone. I have finally solved the problem with not being able to create new chunks and template variables! I tried manually clearing the cache by deleting the core/cache files, but that had no effect. So I just upgraded modx to 2.3 from 2.2.5. That did the trick.