Add error output for mobile Safari
Improve debug outpuput