Sorry for this, I wrote the example in haste.
Limit checking was erroneous, it works in the example just because the
limit is 0. This is the correct way:
function
LimitedAccount:withdraw(amount)
if self:getbalance() - amount < self.limit then
...
Regards,
Hugo Etchegoyen