Add a boundary check to _str2bool