Throws a JS error when Object.keys is invoked on non-object. Fixes #303
Merge pull request #354 from tessel/tcr-303

Throws a JS error when Object.keys is invoked on non-object. Fixes #303