51 ah, the good old "it suddenly worked, no idea why" thing.
"fun" fact: I've gotten to the point where I'm using so many functions that return functions that lua thinks tail call recursion happened. Giving stack traces like
\t(...tail calls...)
\t[string \"return {...\"]:11: in field \'func\'...