Update main.lua

Further refinements to app opening.