some typedef corrected
refactored v7_val::flags