Adding error logging to pcall. Still needs a little work.