Using hasOwnProperty instead of typeof where I can.