Fix bug in doShowTextDialog
Move more old functions to compat.lua