Merge pull request #654 from timl/fix_ttl_order