Remove debugging code and fix local URL checking.