Fixed some errors when null or undefined is passed to a method expecting an object of some sort
Added some more on-page JS errors likely caused by extensions