Fixed queries using the old database column names