Adding tests for null and correcting ttl logic.