Fixing memory leak in syntax definitions