 }
 
 public func >= (lhs: CoreDataQueryKey, rhs: Any) -> CoreDataQuery {
-    return lhs.compare(.GreaterThanOrEqualToPredicateOperatorType, rhs as! AnyObject)
+    let rhs = asConstant(rhs)
+    return lhs.compare(.GreaterThanOrEqualToPredicateOperatorType, rhs)
 }
 
 public func >= (lhs: CoreDataQueryKey, rhs: CoreDataQueryKey) -> CoreDataQuery {

}

public func <= (lhs: CoreDataQueryKey, rhs: Any) -> CoreDataQuery {
    return lhs.compare(.LessThanOrEqualToPredicateOperatorType, rhs as! AnyObject)
}

public func <= (lhs: CoreDataQueryKey, rhs: CoreDataQueryKey) -> CoreDataQuery {
    return lhs.compare(.LessThanOrEqualToPredicateOperatorType, rhs)
}

//---------------------------------------------------------------------------

}

public func != (lhs: CoreDataQueryKey, rhs: Any?) -> CoreDataQuery {
    let rhs = rhs == nil ? NSNull() : asConstant(rhs!)
    return lhs.compare(.NotEqualToPredicateOperatorType, rhs)
}

public func != (lhs: CoreDataQueryKey, rhs: CoreDataQueryKey) -> CoreDataQuery {
