Fixed the counting of number of functions to match luac