The previous code assumed that pairs() iterates over the table in a specific order which is not a safe assumption. Signed-off-by: Uli Schlachter <psychon@znc.in>