fix pointer error in submessage handling
add submessage depth to all submessage_state_arrays (needs testing)
fix zero length arrays (needs heavy testing)
fixed overload flag problem