Changes do according the the sepc, last pull had an issue.
Fixed the if, duh! Me sleepy.
Sync with upstream.
Potential fix for #240
Using Object.keys() instead.
Merge pull request #251 from hemanth/master

Potential fix for #240
Revert of #251 - turns out this doesn't fix #240