obsolete function

It seems that table.getn() has become obsolete since Lua 5.2. Replacing it with the #-operator seems to do the trick.