Utility method for converting string to bool.