Adjusted a few queries to properly handle the extra columns in the tables