use valueOf() for == check in comparePrimitive()