I had to put the check for 'typeof console != "undefined"' back in, otherwise IE complains about console not being defined.