Smarter casting of string to Boolean