Fixes Bug 497

Fixes Bug 497, using an Object.prototype.valueOf comparison.