improved error handling and 'init.lua' cases