Improve valid() in rar format, fixing issue #459