 <cfif isdefined("trap_identifier") and len(trap_identifier) gt 0>
   <cfset mapurl = "#mapurl#&trap_identifier=#trap_identifier#">
   <cfif compare(trap_identifier,"NULL") is 0>
-      <cfset basQual = " #basQual# AND ConcatAttributeValue(flat.collection_object_id,"trap_identifier") is null">
+      <cfset basQual = " #basQual# AND ConcatAttributeValue(flat.collection_object_id,'trap_identifier') is null">
   <cfelse>
     <cfset basJoin = " #basJoin# INNER JOIN v_attributes tbl_trap_identifier ON (#session.flatTableName#.collection_object_id = tbl_trap_identifier.collection_object_id)">
     <cfset basQual = " #basQual# AND tbl_trap_identifier.attribute_type = 'trap identifier'">

<cfif isdefined("caste") and len(caste) gt 0>
  <cfset mapurl = "#mapurl#&caste=#caste#">
  <cfif compare(caste,"NULL") is 0>
      <cfset basQual = " #basQual# AND ConcatAttributeValue(flat.collection_object_id,"caste") is null">
  <cfelse>
    <cfset basJoin = " #basJoin# INNER JOIN v_attributes tbl_caste ON (#session.flatTableName#.collection_object_id = tbl_caste.collection_object_id)">
    <cfset basQual = " #basQual# AND tbl_caste.attribute_type = 'caste'">

<cfif isdefined("egg_content_weight") and len(egg_content_weight) gt 0>
  <cfset mapurl = "#mapurl#&egg_content_weight=#egg_content_weight#">
  <cfif compare(egg_content_weight,"NULL") is 0>
      <cfset basQual = " #basQual# AND ConcatAttributeValue(flat.collection_object_id,'egg_content_weight') is null">
  <cfelse>
    <cfset basJoin = " #basJoin# INNER JOIN v_attributes tbl_egg_content_weight ON (#session.flatTableName#.collection_object_id = tbl_egg_content_weight.collection_object_id)">
    <cfset basQual = " #basQual# AND tbl_egg_content_weight.attribute_type = 'egg content weight'">
