Fix uses of ttl
Merge pull request #3 from camspiers/ttl-var-bug

Fix uses of ttl