Creating a band mix from wave fiels

Hi,

I am trying to create routes from templates to automate importing our band rehearsal recordings.
To do that I do

local rl = Session:new_route_from_template (1, insert_at, template_name, pools_tracks[i]['name'], ARDOUR.PlaylistDisposition.NewPlaylist)

However, when I want to iterate over rl which is supposed to be a RouteList, LUA says:

LuaException: [string "ardour {..."]:191: bad argument #1 to 'iter' (RouteList expected, got table)

In Log-Viewer, I cannot see error message. The template path I provide is correct, I have checked that.

Any help is highly appreciated.
Regards,
robert

I have got an answer to this already, was a syntax error in one of the preceding lines.
Please do not bother with this, anymore.
Thanks.