Adding troubleshooting code.