Moved to typeof to avoid ReferenceError console spam.