Corrected selectAll and updateAll queries