Fix object type checking: Use constructor.name instean of typeof

- Define Object.keys function if not define