Optimize keys check and fix? for node-webkit

Resolves #417