Database queries fixed to correctly handle the 'id' field.