Misc changes, update to new query syntax