add parse_attr_bool, and fix a possible segfault