Dynamic import errors

In case you don't want to pull the full set of query changes, I think these two commits should be less controversial.