Order of console.log versus console.error statements in iOS doesn't seem to be guaranteed, so changed the all to console.log except for the last one (if an error exists), which I put in a setTimeout to be sure it's last.