Fixing Lua event handling of buttons and text (part 1)