Better error checking in app delegate, hopefully last of style feedback in review.