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

<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">
  <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("right_gonad_width") and len(right_gonad_width) gt 0>
  <cfset mapurl = "#mapurl#&right_gonad_width=#right_gonad_width#">
  <cfif compare(right_gonad_width,"NULL") is 0>
      <cfset basQual = " #basQual# AND ConcatAttributeValue(flat.collection_object_id,'right_gonad_width') is null">
  <cfelse>
    <cfset basJoin = " #basJoin# INNER JOIN v_attributes tbl_right_gonad_width ON (#session.flatTableName#.collection_object_id = tbl_right_gonad_width.collection_object_id)">
    <cfset basQual = " #basQual# AND tbl_right_gonad_width.attribute_type = 'right gonad width'">
