Only walk local keys of resources object

Using for...in walks the Object prototype in addition to local keys which is bad in this case if you've added stuff to Object. Using Object.keys() instead avoids this issue.