fix a couple of bugs
use valueOf() for == check in comparePrimitive()
fix preAdd() call in reset()
clear @byId in reset()