I've done this in a bit different way: when the value is already `bool` or `int`, we can't call `value.lower()`.