Make class.lua slightly more robust.