Adding more logging to help work through construction issue in query