correct handling of empty structs in the _next_ function